{
  "$schema": "01_schema/claude_ui_states.schema.json",
  "project": "Claude Code UI Reconstruction — Multi-Agent Pipeline",
  "scenes": [
    {
      "scene_id": "scene_idle_001",
      "state_type": "idle_state",
      "duration_seconds": 3,
      "payload": {
        "mode": "code",
        "prompt_placeholder": "Type a prompt or / for commands",
        "status_bar": {
          "permission_mode": "bypass permissions on",
          "hint": "shift+tab to cycle",
          "interrupt": "esc to interrupt",
          "context_used": "12%"
        }
      }
    },
    {
      "scene_id": "scene_context_reset_001",
      "state_type": "context_reset_state",
      "duration_seconds": 4,
      "payload": {
        "reset_type": "compression",
        "message": "Context compressed: 85k → 32k tokens",
        "old_tokens": "85k",
        "new_tokens": "32k"
      }
    },
    {
      "scene_id": "scene_multi_agent_001",
      "state_type": "multi_agent_task_state",
      "duration_seconds": 6,
      "payload": {
        "main_task": {
          "title": "创建交互式总控入口和控制器...",
          "elapsed": "1m 23s",
          "tokens": "6.7k",
          "status": "running"
        },
        "subtasks": [
          {
            "title": "创建交互式总控入口和控制器",
            "status": "running",
            "indent": 1
          },
          {
            "title": "创建 Amazon 公开产品事实采集脚本",
            "status": "pending",
            "indent": 1
          },
          {
            "title": "创建公开网页产品事实采集脚本",
            "status": "pending",
            "indent": 1
          },
          {
            "title": "重构总控编排器为7层结构",
            "status": "pending",
            "indent": 1
          },
          {
            "title": "编译测试 + 执行非交互测试",
            "status": "pending",
            "indent": 1
          }
        ],
        "agents": [
          {
            "name": "main",
            "role": "main",
            "status": "active",
            "task": "",
            "elapsed": "",
            "tokens": ""
          },
          {
            "name": "general-purpose",
            "role": "worker",
            "status": "running",
            "task": "创建 Amazon 公开产品事实采集脚本...",
            "elapsed": "22s",
            "tokens": "23.7k"
          },
          {
            "name": "general-purpose",
            "role": "worker",
            "status": "running",
            "task": "创建公开网页产品事实采集脚本...",
            "elapsed": "16s",
            "tokens": "21.5k"
          }
        ],
        "permission_bar": {
          "mode": "bypass permissions on",
          "hint": "shift+tab to cycle",
          "interrupt": "esc to interrupt"
        }
      }
    },
    {
      "scene_id": "scene_bash_001",
      "state_type": "bash_success_state",
      "duration_seconds": 5,
      "payload": {
        "command": "python scripts/run_pipeline.py --mode full",
        "output_lines": [
          {
            "text": "$ python scripts/run_pipeline.py --mode full",
            "color": "white"
          },
          {
            "text": "[1/5] Loading raw data from CSV...",
            "color": "dim"
          },
          {
            "text": "  OK: 89 candidates loaded",
            "color": "green"
          },
          {
            "text": "[2/5] Validating required fields...",
            "color": "dim"
          },
          {
            "text": "  All 89 candidates have required fields",
            "color": "green"
          },
          {
            "text": "  -> Quality Gate: PASSED (score: 1.0)",
            "color": "green"
          },
          {
            "text": "[3/5] Data enrichment... OK",
            "color": "green"
          },
          {
            "text": "[4/5] Scoring... OK",
            "color": "green"
          },
          {
            "text": "[5/5] Export... TOP20 exported",
            "color": "green"
          },
          {
            "text": "=== SUCCESS: Pipeline completed ===",
            "color": "green"
          }
        ],
        "exit_code": 0
      }
    },
    {
      "scene_id": "scene_write_001",
      "state_type": "write_file_state",
      "duration_seconds": 4,
      "payload": {
        "file_path": "src/quality_gate.py",
        "lines_written": 84,
        "content_preview": "REQUIRED_FIELDS = [\"aweme_id\", \"title\", \"author\", \"link\", \"description\"]",
        "status": "created"
      }
    },
    {
      "scene_id": "scene_diff_001",
      "state_type": "update_diff_state",
      "duration_seconds": 5,
      "payload": {
        "file_path": "src/quality_gate.py",
        "diff_lines_added": 12,
        "diff_lines_removed": 3,
        "diff_preview": [
          {
            "type": "context",
            "text": "    for i, c in enumerate(candidates):"
          },
          {
            "type": "context",
            "text": "        missing = []"
          },
          {
            "type": "remove",
            "text": "        if 'link' not in c:"
          },
          {
            "type": "add",
            "text": "        for field in REQUIRED_FIELDS:"
          },
          {
            "type": "add",
            "text": "            if field not in c or not c[field]:"
          },
          {
            "type": "add",
            "text": "                missing.append(field)"
          },
          {
            "type": "context",
            "text": "        if missing:"
          }
        ]
      }
    },
    {
      "scene_id": "scene_bash_error_001",
      "state_type": "bash_error_state",
      "duration_seconds": 5,
      "payload": {
        "command": "python rebuild_pipeline.py --fail",
        "output_lines": [
          {
            "text": "$ python rebuild_pipeline.py --fail",
            "color": "white"
          },
          {
            "text": "[1/5] Loading... OK: 89 candidates",
            "color": "dim"
          },
          {
            "text": "[2/5] Validating...",
            "color": "dim"
          },
          {
            "text": "  ERROR: Missing field 'link' for 12 candidates",
            "color": "red"
          },
          {
            "text": "  ERROR: Missing field 'author' for 5 candidates",
            "color": "red"
          },
          {
            "text": "  -> Quality Gate: FAILED (score: 0.809)",
            "color": "red"
          },
          {
            "text": "=== FAILED: 0/89 passed quality gate ===",
            "color": "red"
          }
        ],
        "exit_code": 1
      }
    },
    {
      "scene_id": "scene_diff_002",
      "state_type": "update_diff_state",
      "duration_seconds": 5,
      "payload": {
        "file_path": "config/thresholds.json",
        "diff_lines_added": 8,
        "diff_lines_removed": 0,
        "diff_preview": [
          {
            "type": "add",
            "text": "  \"quality_gate\": {"
          },
          {
            "type": "add",
            "text": "    \"min_score\": 0.85,"
          },
          {
            "type": "add",
            "text": "    \"required_fields\": ["
          },
          {
            "type": "add",
            "text": "      \"aweme_id\", \"title\", \"author\","
          },
          {
            "type": "add",
            "text": "      \"link\", \"description\""
          },
          {
            "type": "add",
            "text": "    ]"
          }
        ]
      }
    },
    {
      "scene_id": "scene_task_001",
      "state_type": "task_progress_state",
      "duration_seconds": 4,
      "payload": {
        "task_id": "TSK-001",
        "subject": "Implement quality gate validation",
        "description": "Add REQUIRED_FIELDS check to pipeline",
        "status": "in_progress",
        "progress_percent": 72
      }
    },
    {
      "scene_id": "scene_final_001",
      "state_type": "final_status_state",
      "duration_seconds": 5,
      "payload": {
        "verdict": "PASS",
        "summary": "Pipeline completed: 89 candidates → quality gate passed → TOP20 exported",
        "file_count": 4,
        "elapsed": "2m 45s",
        "token_usage": "12.3k tokens total"
      }
    }
  ]
}